// import settings from '@/config/setting.config';
const mockOpen = true;

export default ({ mock, setup }: { mock?: boolean; setup: () => void }) => {
  if (mock !== false && mockOpen) setup();
};

export const successResponseWrap = (data: unknown) => {
  return {
    data,
    status: 'success',
    msg: '请求成功',
    code: 20000
  };
};

export const failResponseWrap = (data: unknown, msg: string, code = 50000) => {
  return {
    data,
    status: 'error',
    msg,
    code
  };
};
